www.gusucode.com > VC 2D游戏编辑器-源码程序 > VC 2D游戏编辑器-源码程序/code/mapedit_source/dialog/Property1.cpp

    //Download by http://www.NewXing.com
// Property1.cpp : implementation file
//

#include "stdafx.h"
#include "..\\MapEdit.h"
#include "Property1.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CProperty1 dialog


CProperty1::CProperty1(CWnd* pParent /*=NULL*/)
	: CDialog(CProperty1::IDD, pParent)
{
	//{{AFX_DATA_INIT(CProperty1)
	m_height_used = FALSE;
	m_id_used = FALSE;
	m_pass = FALSE;
	m_pass_used = FALSE;
	m_type_used = FALSE;
	m_height = 0;
	m_id = 0;
	m_type = 0;
	//}}AFX_DATA_INIT
}


void CProperty1::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CProperty1)
	DDX_Check(pDX, IDC_HEIGHT_USED, m_height_used);
	DDX_Check(pDX, IDC_ID_USED, m_id_used);
	DDX_Check(pDX, IDC_PASS, m_pass);
	DDX_Check(pDX, IDC_PASS_USED, m_pass_used);
	DDX_Check(pDX, IDC_TYPE_USED, m_type_used);
	DDX_Text(pDX, IDC_HEIGHT, m_height);
	DDV_MinMaxInt(pDX, m_height, 0, 31);
	DDX_Text(pDX, IDC_ID, m_id);
	DDV_MinMaxInt(pDX, m_id, 0, 127);
	DDX_Text(pDX, IDC_TYPE, m_type);
	DDV_MinMaxInt(pDX, m_type, 0, 7);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CProperty1, CDialog)
	//{{AFX_MSG_MAP(CProperty1)
	ON_BN_CLICKED(IDC_HEIGHT_USED, OnHeightUsed)
	ON_BN_CLICKED(IDC_PASS_USED, OnPassUsed)
	ON_BN_CLICKED(IDC_TYPE_USED, OnTypeUsed)
	ON_BN_CLICKED(IDC_ID_USED, OnIdUsed)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CProperty1 message handlers

void CProperty1::OnHeightUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_HEIGHT)->IsWindowEnabled())
	{
		GetDlgItem(IDC_HEIGHT)->EnableWindow(FALSE);
		GetDlgItem(IDC_STATIC_HEIGHT)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_HEIGHT)->EnableWindow(TRUE);
		GetDlgItem(IDC_STATIC_HEIGHT)->EnableWindow(TRUE);
	}
}

void CProperty1::OnPassUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_PASS)->IsWindowEnabled())
	{
		GetDlgItem(IDC_PASS)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_PASS)->EnableWindow(TRUE);
	}
}

void CProperty1::OnTypeUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_TYPE)->IsWindowEnabled())
	{
		GetDlgItem(IDC_TYPE)->EnableWindow(FALSE);
		GetDlgItem(IDC_STATIC_TYPE)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_TYPE)->EnableWindow(TRUE);
		GetDlgItem(IDC_STATIC_TYPE)->EnableWindow(TRUE);
	}
}

void CProperty1::OnIdUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_ID)->IsWindowEnabled())
	{
		GetDlgItem(IDC_ID)->EnableWindow(FALSE);
		GetDlgItem(IDC_STATIC_ID)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_ID)->EnableWindow(TRUE);
		GetDlgItem(IDC_STATIC_ID)->EnableWindow(TRUE);
	}
}